//@ sourceURL=CultureActivityForm.js
CultureActivityForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        CultureActivityForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "添加安全文化活动",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/safecultruetrain/saveCultureActivity.do",
                items:[
                {
                    id : "cultureActivity.id",
                    name : "cultureActivity.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "cultureActivity.years",
                    xtype : "hidden",
                    id : "cultureActivity.years",
                    value : this.years == null ? "" : this.years
                },{
				layout : "column",
				//      border:false,
				bodyStyle : "padding:5px;",
				items : [
						{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : '活动名称'
										+ '<font color=red>*</font>',
								id : "cultureActivity.activityName",
								name : "cultureActivity.activityName",
								maxLength : 80,
								width : 146,
								allowBlank : false,
								blankText : "活动名称不能为空！"
							} ]
						},
						{
							layout : "form",
							border : false,
							columnWidth : .5,
							items : [ {
								//下拉选型设置
								fieldLabel : "所属机构",
								hiddenName : "cultureActivity.institution",
								xtype : "combo",
								mode : "local",
								editable : false,
								width : 146,
								triggerAction : "all",
								store : [
										[ "1",
												"组织部" ],
										[ "2",
												"财务部" ],
										[ "3",
												"销售部" ] ],
								value : 3
							} ]
						},
						{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : "活动主题",
								id : "cultureActivity.title",
								name : "cultureActivity.title",
								maxLength : 80,
								width : 146,
								allowBlank : true
							} ]
						},
						{
							layout : "form",
							columnWidth : .5,
							border : false,
							items : [ {
								xtype : "datefield",
								fieldLabel : '活动时间'
										+ '<font color=red>*</font>',
								id : "cultureActivity.activityDate",
								format : "y-m-d",
								name : "cultureActivity.activityDate",
								width : 146,
								allowBlank : false,
								blankText : "活动时间不能为空！"
							} ]
						},
						{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : "活动经费",
								id : "cultureActivity.activityfunds",
								name : "cultureActivity.activityfunds",
								maxLength : 80,
								width : 146,
								allowBlank : true

							} ]
						},
						{
							layout : "form",
							columnWidth : .5,
							border : false,
							items : [ {
								xtype : "textfield",
								fieldLabel : '主办方'
										+ '<font color=red>*</font>',
								id : "cultureActivity.sponsor",
								format : "y-m-d",
								name : "cultureActivity.sponsor",
								width : 146,
								allowBlank : false,

							} ]
						} ]
			},{
			layout : "column",
			bodyStyle : "padding:5px;",
			items : [
					{
						layout : "form",
						//      border:false,
						bodyStyle : "padding:5px;",
						columnWidth : 1.,
						items : [ {
							xtype : "textarea",
							fieldLabel : '活动效果',
							name : 'cultureActivity.effect',
							/*maxLength:300,
							height:25,*/
							width : 448
						} ]
					},
					{
						columnWidth : 1.,//第一列 
						layout : "form",
						//            border : false,
						bodyStyle : "padding:5px;",
						items : [ {
							xtype : "textarea",
							fieldLabel : '备注',
							name : 'cultureActivity.remark',
							width : 448
						} ]
					} ]
		       }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/safecultruetrain/getCultureActivity.do",
                preName : "cultureActivity"
            }
        });
    }
});
